<template>
	<div class="hottable">
		<div class="head">
			<h4>商品类型</h4>
			<router-link to="/admin/update" class="addnew">添加一层类型</router-link>
		</div>
		<div class="line"></div>
		<el-table :data="booklist" height="500" border style="width: 100%;height: 500px;">
			<el-table-column prop="id" label="一级编号">
			</el-table-column>
			<el-table-column prop="prio" label="顺序">
			</el-table-column>
			<el-table-column prop="name" label="一级类型名字">
			</el-table-column>

			<el-table-column prop="change" label="修改">
				<router-link to="/admin/update">修改</router-link>
			</el-table-column>
			<el-table-column prop="name2" label="二级类型名字">
			</el-table-column>
			<el-table-column prop="del" label="添加二级">
				<div class="addnew2">
					<router-link to="/admin/update" class="add">加</router-link>
				</div>
			</el-table-column>
		</el-table>
	</div>
</template>


<script>
	export default {
		name: 'AdminType',
		data() {
			return {
				booklist: []
			}
		},
		computed: {},
		methods: {
			findList1() {
				this.$get('/api/adm/type/findAll2').then((resp) => {
					console.log(resp.data);
					this.booklist = resp.data.data;
				})
			},

		},
		mounted() {
			this.findList1();
		}
	}
</script>

<style scoped>
	a {
		color: #000000;
	}
	.head{
		display: flex;
		justify-content: space-between;
	}
	.line {
		border: #409eff 1px solid;
		width: 100%;
		margin-bottom: 10px;
	}

	.addnew {
		line-height: 2em;
		height: 2em;
		border-radius: 5px;
		width: 130px;
		color: white;
		background-color: #409eff;
		margin-bottom: 10px;
	}

	.addnew2 {
		line-height: 2em;
		border-radius: 5px;
		width: 2.5em;
		text-align: center;
		background-color: #409eff;
	}

	.add {
		color: white;
	}
</style>
